home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks1 / AppKit.framework / Headers / NSBitmapImageRep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-20  |  3.8 KB  |  100 lines

  1. /*
  2.     NXBitmapImageRep.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "NSImageRep.h"
  8. #import <objc/List.h>
  9. #import <streams/streams.h>
  10. #import <objc/zone.h>
  11. #import "obsoleteGraphics.h"
  12.  
  13. typedef enum _NSTIFFCompression {
  14.     NSTIFFCompressionNone        = 1,
  15.     NSTIFFCompressionCCITTFAX3        = 3,        /* 1 bps only */
  16.     NSTIFFCompressionCCITTFAX4        = 4,        /* 1 bps only */
  17.     NSTIFFCompressionLZW        = 5,
  18.     NSTIFFCompressionJPEG        = 6,
  19.     NSTIFFCompressionNEXT        = 32766,    /* Input only */
  20.     NSTIFFCompressionPackBits        = 32773,
  21.     NSTIFFCompressionOldJPEG        = 32865        /* Input only */
  22. } NSTIFFCompression;
  23.  
  24. @interface NSBitmapImageRep : NSImageRep
  25. {
  26.     unsigned int        _bytesPerRow;
  27.     unsigned short      _imageNumber;
  28.     short        _colorSpace;
  29.     struct __bitmapRepFlags {
  30. #ifdef __BIG_ENDIAN__
  31.     unsigned int isPlanar:1;
  32.     unsigned int explicitPlanes:1;
  33.     unsigned int bitsPerPixel:8;    
  34.     unsigned int unpackedOK:1;
  35.     unsigned int isUnpacked:1;
  36.     unsigned int memory:2;
  37.     unsigned int _RESERVED:2;
  38. #else
  39.     unsigned int _RESERVED:2;
  40.     unsigned int memory:2;
  41.     unsigned int isUnpacked:1;
  42.     unsigned int unpackedOK:1;
  43.     unsigned int bitsPerPixel:8;
  44.     unsigned int explicitPlanes:1;
  45.     unsigned int isPlanar:1;
  46. #endif
  47.     }                   _moreRepFlags;
  48.     unsigned short      _reservedB1;
  49.     char               *_fileName;
  50.     int            _reservedB2;
  51.     unsigned char      *_data;
  52.     char           *_otherName;
  53.     unsigned short      _compression;
  54.     unsigned short      _factor;
  55. }
  56.  
  57. - initFromSection:(NSString *)fileName;
  58. - initFromFile:(NSString *)fileName;
  59. - initFromStream:(NXStream *)stream;
  60. - initData:(unsigned char *)data fromRect:(NSRect)rect;
  61. - initData:(unsigned char *)data pixelsWide:(int)width pixelsHigh:(int)height bitsPerSample:(int)bps samplesPerPixel:(int)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpace:(NXColorSpace)colorSpace bytesPerRow:(int)rBytes bitsPerPixel:(int)pBits;
  62. - initDataPlanes:(unsigned char **)planes pixelsWide:(int)width pixelsHigh:(int)height bitsPerSample:(int)bps samplesPerPixel:(int)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpace:(NXColorSpace)colorSpace bytesPerRow:(int)rBytes bitsPerPixel:(int)pBits;
  63.  
  64. + (int)sizeImage:(NSRect)rect;
  65. + (int)sizeImage:(NSRect)rect pixelsWide:(int *)width pixelsHigh:(int *)height bitsPerSample:(int *)bps samplesPerPixel:(int *)spp hasAlpha:(BOOL *)hasAlpha isPlanar:(BOOL *)isPlanar colorSpace:(NXColorSpace *)colorSpace;
  66.  
  67. + (NSArray *)newListFromSection:(NSString *)fileName;
  68. + (NSArray *)newListFromFile:(NSString *)fileName;
  69. + (NSArray *)newListFromStream:(NXStream *)stream;
  70. + (NSArray *)newListFromSection:(NSString *)fileName zone:(NSZone *)zone;
  71. + (NSArray *)newListFromFile:(NSString *)fileName zone:(NSZone *)zone;
  72. + (NSArray *)newListFromStream:(NXStream *)stream zone:(NSZone *)zone;
  73.  
  74. - (unsigned char *)data;
  75. - getDataPlanes:(unsigned char **)data;
  76. - (BOOL)isPlanar;
  77. - (int)samplesPerPixel;
  78. - (int)bitsPerPixel;
  79. - (int)bytesPerRow;
  80. - (int)bytesPerPlane;
  81. - (int)numPlanes;
  82. - (NXColorSpace)colorSpace;
  83. - (BOOL)drawIn:(NSRect)rect;
  84. - (BOOL)draw;
  85. - (void)getCompression:(NSTIFFCompression *)compression andFactor:(float *)factor;
  86. - (void)setCompression:(NSTIFFCompression)compression andFactor:(float)factor;
  87. - writeTIFF:(NXStream *)stream;
  88. - writeTIFF:(NXStream *)stream usingCompression:(NSTIFFCompression)compression;
  89. - writeTIFF:(NXStream *)stream usingCompression:(NSTIFFCompression)compression andFactor:(float)compressionFactor;
  90. + (void)getTIFFCompressionTypes:(const NSTIFFCompression **)list count:(int *)numTypes;
  91. + (NSString *)localizedNameForTIFFCompressionType:(NSString *)compression;
  92. - (BOOL)canBeCompressedUsing:(NSTIFFCompression)compression;
  93. + (void)setUnpackedImageDataAcceptable:(BOOL)flag;
  94. + (BOOL)isUnpackedImageDataAcceptable;
  95. - read:(NXTypedStream *)stream;
  96. - write:(NXTypedStream *)stream;
  97. - (void)dealloc;
  98.  
  99. @end
  100.